home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 September / maximum-cd-2000-09.iso / Vampire the Masquerade / vampire_demo.exe / Codex.nob / TEU4_Main_Demo.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-22  |  7.9 KB  |  328 lines

  1. public class TEU4_Main_Demo extends Codex {
  2.    private Demo2Chronicle chronScript = (Demo2Chronicle)((Codex)this).GetChronicleScript(0);
  3.    private CodexRegion _KnightRegion;
  4.    private CodexActor _Knight1;
  5.    private CodexActor _Knight2;
  6.    private CodexActor _Orsi;
  7.    private CodexActor _Corpse;
  8.    private CodexThing _Switch;
  9.    private CodexActor _serena;
  10.    private CodexActor _christof;
  11.    private CodexActor _wilhem;
  12.    private CodexActor _erik;
  13.    private int christofGUID;
  14.    private int erikGUID;
  15.    private int orsiGUID;
  16.    private int serenaGUID;
  17.    private int wilhemGUID;
  18.    private float[] pos;
  19.    private float[] corpsePos;
  20.    public int bOrsiPos;
  21.    public boolean bOrsiConversation;
  22.    public boolean bSerenaCorpseConversation;
  23.    public boolean bTeutonicConversation;
  24.    public boolean bFreedomConversation;
  25.    private static final int TIMER_ID_SERENACORPSE = 1;
  26.    private static final int TIMER_ID_CORPSEGETUP = 2;
  27.    private static final int TIMER_ID_CORPSEWALK = 3;
  28.    private static final int TIMER_ID_CORPSESWITCH = 4;
  29.    private static final int TIMER_ID_DOOROPEN = 5;
  30.    private static final int TIMER_ID_CORPSECOLAPSE = 6;
  31.    private static final int TIMER_ID_FREEDOMCONV = 7;
  32.    private static final int TIMER_ID_FADEOUT = 8;
  33.    private static final int TIMER_ID_FADEIN = 9;
  34.    public static String[] _params = new String[]{"Teutonic Knight region", "Teutonic Knight 1", "Teutonic Knight 2", "Orsi", "Corpse", "Switch"};
  35.  
  36.    public void SerenaCorpseConversation(int starterGuid, int npcGuid) {
  37.       CodexSound.PushMusic("DA_Conversation_1.mp3", 50);
  38.       this.bSerenaCorpseConversation = true;
  39.       ((Codex)this).AIOff();
  40.       CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 1);
  41.       ((Codex)this).ExecuteConversation(starterGuid, npcGuid, "Demo_SerenaCorpse", "Demo_SerenaCorpse.nco", 4);
  42.    }
  43.  
  44.    public void textended(int readerGuid) {
  45.       this._Corpse.PlayActorMotionSetMode(141, false, 30.0F);
  46.       this.OrsiConversation(readerGuid, 0);
  47.    }
  48.  
  49.    public void convended(int starterGuid, boolean bAborted, int returnValue) {
  50.       if (this.bOrsiConversation) {
  51.          CodexSound.PopMusic();
  52.          ((Codex)this).AIOn();
  53.          this.bOrsiConversation = false;
  54.          new CodexQuest(CodexQuest.Load("V1_EscapeKnightBase"));
  55.          this.OrsiLeaves();
  56.       }
  57.  
  58.       if (this.bSerenaCorpseConversation) {
  59.          ((Codex)this).AIOn();
  60.          this.bSerenaCorpseConversation = false;
  61.          ((Codex)this).SetTimer(1.0F, 2);
  62.       }
  63.  
  64.       if (this.bFreedomConversation) {
  65.          CodexSound.PopMusic();
  66.          ((Codex)this).AIOn();
  67.          this.bFreedomConversation = false;
  68.          CodexCamera.Release(starterGuid);
  69.       }
  70.  
  71.       if (this.bTeutonicConversation) {
  72.          ((Codex)this).AIOn();
  73.          this.bTeutonicConversation = false;
  74.          CodexCamera.Release(starterGuid);
  75.       }
  76.  
  77.    }
  78.  
  79.    public void beginscene(int clientGuid, int captureID) {
  80.       this._Corpse.SetActorFlags(4);
  81.       if (!CodexSequence.GetChronicleFlag(50)) {
  82.          CodexSequence.SetChronicleFlag(50);
  83.          this.christofGUID = CodexThing.GuidFromCastID("Christof");
  84.          this.erikGUID = CodexThing.GuidFromCastID("Erik");
  85.          this.serenaGUID = CodexThing.GuidFromCastID("Serena");
  86.          this.wilhemGUID = CodexThing.GuidFromCastID("Wilhem");
  87.          this.orsiGUID = CodexThing.GuidFromCastID("Orsi");
  88.          CodexPlayer Wilhem = new CodexPlayer(this.wilhemGUID);
  89.          CodexPlayer Erik = new CodexPlayer(this.erikGUID);
  90.          CodexPlayer Serena = new CodexPlayer(this.serenaGUID);
  91.          CodexPlayer Christof = new CodexPlayer(CodexThing.GuidFromCastID("Christof"));
  92.          ((CodexThing)Christof).SetFoley("playerChristof.nag");
  93.          Wilhem.AddToParty();
  94.          Serena.AddToParty();
  95.          Erik.AddToParty();
  96.          CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 0);
  97.          this._serena = new CodexActor(this.serenaGUID);
  98.          this._christof = new CodexActor(this.christofGUID);
  99.          this._wilhem = new CodexActor(this.wilhemGUID);
  100.          this._erik = new CodexActor(this.erikGUID);
  101.          CodexCamera.AddFade(CodexPlayer.GetCurrentPlayer(), 0.0F, 255.0F, 1.0F, false);
  102.          ((Codex)this).ExecuteText(clientGuid, super.guid, "IntroTextDemo2");
  103.       }
  104.  
  105.    }
  106.  
  107.    public void arrived(int thingGuid, int frameNum, int captureId) {
  108.       if (thingGuid == this._Orsi.GetGUID()) {
  109.          if (this.bOrsiPos < this._Orsi.GetNumFrames() - 1) {
  110.             ++this.bOrsiPos;
  111.             this.pos = this._Orsi.GetFramePosition(this.bOrsiPos);
  112.             this._Orsi.SendActorToPos(this.pos, 90.0F);
  113.          }
  114.       } else if (thingGuid == this._Corpse.GetGUID()) {
  115.          this._Corpse.LookAtThing(this._Switch.GetGUID());
  116.          int duration = this._Corpse.PlayActorMotionSetMode(89, false, 30.0F);
  117.          ((Codex)this).SetTimer((float)duration / 1800.0F, 4);
  118.       }
  119.  
  120.    }
  121.  
  122.    public void FreedomConversation(int starterGuid, int npcGuid) {
  123.       this.bFreedomConversation = true;
  124.       ((Codex)this).AIOff();
  125.       CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 1);
  126.       ((Codex)this).ExecuteConversation(starterGuid, npcGuid, "Demo_Freedom", "Demo_Freedom.nco", 4);
  127.    }
  128.  
  129.    public void TeutonicConversation(int starterGuid, int npcGuid) {
  130.       this.bTeutonicConversation = true;
  131.       ((Codex)this).AIOff();
  132.       CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 2);
  133.       ((Codex)this).ExecuteConversation(starterGuid, npcGuid, "Demo_Teutonic", "Demo_Teutonic.nco", 4);
  134.    }
  135.  
  136.    public void entered(int guid, int causeGUID, int captureID) {
  137.       if (Codex.IsPlayerGuid(causeGUID)) {
  138.          if (guid == this._KnightRegion.GetGUID() && !CodexSequence.GetChronicleFlag(51)) {
  139.             CodexSequence.SetChronicleFlag(51);
  140.             this.TeutonicConversation(causeGUID, 0);
  141.          }
  142.  
  143.       }
  144.    }
  145.  
  146.    public void convreached(int starterGuid, int curEvent, int curLine, int lineDuration, int speakerGuid) {
  147.       if (this.bOrsiConversation) {
  148.          switch (curEvent) {
  149.             case 0:
  150.                switch (curLine) {
  151.                   case 0:
  152.                      CodexCamera.SetupCutscene(starterGuid, this.christofGUID, this.orsiGUID);
  153.                      CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
  154.                      break;
  155.                   case 1:
  156.                      CodexCamera.SetShot(starterGuid, 1, 2, 2, 0, 0.0F);
  157.                      break;
  158.                   case 2:
  159.                      CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
  160.                      break;
  161.                   case 3:
  162.                      CodexCamera.SetShot(starterGuid, 1, 2, 2, 0, 0.0F);
  163.                      break;
  164.                   case 4:
  165.                      CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
  166.                      break;
  167.                   case 5:
  168.                      CodexCamera.SetShot(starterGuid, 1, 2, 2, 0, 0.0F);
  169.                      break;
  170.                   case 6:
  171.                      CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
  172.                      break;
  173.                   case 7:
  174.                      CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
  175.                }
  176.          }
  177.       }
  178.  
  179.       if (this.bSerenaCorpseConversation) {
  180.          switch (curEvent) {
  181.             case 0:
  182.                switch (curLine) {
  183.                   case 0:
  184.                      CodexCamera.SetupCutscene(starterGuid, this.wilhemGUID, this.erikGUID);
  185.                      CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
  186.                      break;
  187.                   case 1:
  188.                      CodexCamera.SetShot(starterGuid, 3, 2, 2, 0, 0.0F);
  189.                      break;
  190.                   case 2:
  191.                      CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
  192.                      break;
  193.                   case 3:
  194.                      CodexCamera.SetupCutscene(starterGuid, this.christofGUID, this.serenaGUID);
  195.                      CodexCamera.SetShot(starterGuid, 1, 2, 2, 0, 0.0F);
  196.                      this._christof.LookAtThing(this.serenaGUID);
  197.                      break;
  198.                   case 4:
  199.                      CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
  200.                      break;
  201.                   case 5:
  202.                      CodexCamera.PlayPath(CodexPlayer.GetCurrentPlayer(), ((Codex)this).GetGUID(), "SerenaCast.ncp", 30.0F);
  203.                      this._serena.LookAtThing(this._Corpse.GetGUID());
  204.                      this._christof.LookAtThing(this._Corpse.GetGUID());
  205.                      this._wilhem.LookAtThing(this._Corpse.GetGUID());
  206.                      this._erik.LookAtThing(this._Corpse.GetGUID());
  207.                      this._serena.PlayActorMotionSetMode(147, false, 30.0F);
  208.                }
  209.          }
  210.       }
  211.  
  212.       if (this.bFreedomConversation) {
  213.          switch (curEvent) {
  214.             case 0:
  215.                switch (curLine) {
  216.                   case 0:
  217.                      CodexCamera.SetupCutscene(starterGuid, this.wilhemGUID, this.erikGUID);
  218.                      CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
  219.                      break;
  220.                   case 1:
  221.                      CodexCamera.SetShot(starterGuid, 3, 2, 2, 0, 0.0F);
  222.                      break;
  223.                   case 2:
  224.                      CodexCamera.SetShot(starterGuid, 7, 2, 2, 0, 0.0F);
  225.                }
  226.          }
  227.       }
  228.  
  229.       if (this.bTeutonicConversation) {
  230.          switch (curEvent) {
  231.             case 0:
  232.                switch (curLine) {
  233.                   case 0:
  234.                      CodexCamera.SetupCutscene(starterGuid, speakerGuid, 0);
  235.                      CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
  236.                      break;
  237.                   case 1:
  238.                      CodexCamera.SetupCutscene(starterGuid, speakerGuid, 0);
  239.                      CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
  240.                      break;
  241.                   case 2:
  242.                      CodexCamera.SetupCutscene(starterGuid, speakerGuid, 0);
  243.                      CodexCamera.SetShot(starterGuid, 6, 2, 2, 0, 0.0F);
  244.                }
  245.          }
  246.       }
  247.  
  248.    }
  249.  
  250.    public TEU4_Main_Demo(CodexRegion KnightRegion, CodexActor Knight1, CodexActor Knight2, CodexActor Orsi, CodexActor Corpse, CodexThing Switch) {
  251.       this._KnightRegion = new CodexRegion(((Codex)KnightRegion).GetGUID());
  252.       this._Knight1 = new CodexActor(((Codex)Knight1).GetGUID());
  253.       this._Knight2 = new CodexActor(((Codex)Knight2).GetGUID());
  254.       this._Orsi = new CodexActor(((Codex)Orsi).GetGUID());
  255.       this._Corpse = new CodexActor(((Codex)Corpse).GetGUID());
  256.       this._Switch = new CodexThing(((Codex)Switch).GetGUID());
  257.       ((Codex)this).CaptureThing(this._KnightRegion.GetGUID());
  258.       ((Codex)this).CaptureThing(this._Knight1.GetGUID());
  259.       ((Codex)this).CaptureThing(this._Knight2.GetGUID());
  260.       ((Codex)this).CaptureThing(this._Orsi.GetGUID());
  261.       ((Codex)this).CaptureThing(this._Corpse.GetGUID());
  262.       this.pos = new float[3];
  263.       this.corpsePos = new float[3];
  264.    }
  265.  
  266.    public void timer(int timerID, float arg0, float arg1, float arg2, float arg3) {
  267.       switch (timerID) {
  268.          case 1:
  269.             this._Orsi.Remove();
  270.             this.SerenaCorpseConversation(CodexPlayer.GetCurrentPlayer(), 0);
  271.             break;
  272.          case 2:
  273.             ((Codex)this).BeginCutscene(CodexPlayer.GetCurrentPlayer(), 0);
  274.             float[] offset = new float[3];
  275.             offset[0] = 0.0F;
  276.             offset[1] = 0.0F;
  277.             offset[2] = 0.0F;
  278.             int effectGuid = this._Corpse.SpawnThing("neckBlood");
  279.             this._Corpse.AttachThing(effectGuid, 17, offset, 1);
  280.             int duration = this._Corpse.PlayActorMotionSetMode(140, false, 30.0F);
  281.             ((Codex)this).SetTimer((float)duration / 1000.0F, 3);
  282.             break;
  283.          case 3:
  284.             CodexCamera.PlayPath(CodexPlayer.GetCurrentPlayer(), ((Codex)this).GetGUID(), "CorpseWalk.ncp", 30.0F);
  285.             this.corpsePos = this._Corpse.GetFramePosition(1);
  286.             this._Corpse.StopActorAction();
  287.             this._Corpse.SendActorToPos(this.corpsePos, 30.0F);
  288.             break;
  289.          case 4:
  290.             this._Corpse.ActorActionActivate(this._Switch.GetGUID(), 0);
  291.             ((Codex)this).SetTimer(1.0F, 5);
  292.             break;
  293.          case 5:
  294.             CodexCamera.PlayPath(CodexPlayer.GetCurrentPlayer(), ((Codex)this).GetGUID(), "DoorOpen.ncp", 30.0F);
  295.             ((Codex)this).SetTimer(3.0F, 6);
  296.             break;
  297.          case 6:
  298.             CodexCamera.PlayPath(CodexPlayer.GetCurrentPlayer(), ((Codex)this).GetGUID(), "CorpseWalk.ncp", 30.0F);
  299.             int duration = this._Corpse.PlayActorMotionSetMode(122, false, 20.0F);
  300.             ((Codex)this).SetTimer((float)duration / 1000.0F, 7);
  301.             break;
  302.          case 7:
  303.             this._Corpse.SetActorFlags(268435456);
  304.             this.FreedomConversation(CodexPlayer.GetCurrentPlayer(), 0);
  305.             break;
  306.          case 8:
  307.             ((Codex)this).SetTimer(2.0F, 1);
  308.             CodexCamera.AddFade(CodexPlayer.GetCurrentPlayer(), 255.0F, 0.0F, 4.0F, true);
  309.       }
  310.  
  311.    }
  312.  
  313.    public void OrsiLeaves() {
  314.       ((Codex)this).SetTimer(1.0F, 8);
  315.       this.pos = this._Orsi.GetFramePosition(1);
  316.       this.bOrsiPos = 1;
  317.       this._Orsi.SendActorToPos(this.pos, 90.0F);
  318.    }
  319.  
  320.    public void OrsiConversation(int starterGuid, int npcGuid) {
  321.       CodexSound.PushMusic("DA_Conversation_2.mp3", 50);
  322.       this.bOrsiConversation = true;
  323.       ((Codex)this).AIOff();
  324.       CodexPlayer.TeleportPartyToConversation(CodexPlayer.GetCurrentPlayer(), 0);
  325.       ((Codex)this).ExecuteConversation(starterGuid, npcGuid, "Demo_Orsi", "Demo_Orsi.nco", 4);
  326.    }
  327. }
  328.